home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / vgfx10.zip / MOUSE1.PAS < prev    next >
Pascal/Delphi Source File  |  1994-12-01  |  1KB  |  61 lines

  1. { VGFX Mouse routine demo }
  2.  
  3. uses Crt, VGFX;
  4.  
  5. { Misc. demo variables }
  6. var
  7.    b1, b2, b3: boolean;
  8.  
  9.  
  10. { Main Program }
  11. Begin
  12.      { Initialize VGFX }
  13.      VGFX_Init;
  14.  
  15.      { Initialize the mouse driver & routines }
  16.      If (MInit = -1) then
  17.      begin
  18.           { No mouse driver found }
  19.           VGFX_Done;
  20.           writeln;
  21.           writeln;
  22.           writeln ('Sorry this demo requires a mouse!');
  23.           writeln;
  24.           halt(1);
  25.      end;  { if\then }
  26.  
  27.  
  28.      { Turn the mouse cursor on }
  29.      MShow (1);
  30.      repeat
  31.            { Print the mouses' coords }
  32.            vprint ('Mouse''s X Coord: ' + Int2Str(mX), 15, 15, 1, 255);
  33.            vprint ('Mouse''s Y Coord: ' + Int2Str(mY), 15, 30, 1, 255);
  34.  
  35.            { Get the mouse button status }
  36.            MPress(b1, b2, b3);
  37.  
  38.            if (b1) then
  39.               vprint ('Button 1 is pressed!', 15, 45, 1, 255);
  40.  
  41.            if (b2) then
  42.               vprint ('Button 2 is pressed!', 15, 55, 1, 255);
  43.  
  44.            if (b3) then
  45.               vprint ('Button 3 is pressed!', 15, 65, 1, 255);
  46.  
  47.            if ((not b1) and (not b2) and (not b3)) then
  48.               vprint ('No buttons are pressed!', 15, 45, 1, 255);
  49.  
  50.  
  51.            { Update the mouse cursor }
  52.            MMove;
  53.            Update;
  54.  
  55.      Until (KeyPressed);
  56.  
  57.  
  58.      { Shut-down VGFX and clean up it's mess }
  59.      VGFX_Done;
  60. End.  { Program }
  61.